﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DeltaFlex.Data;
using System.Data;
using Taula = DeltaFlex.Negoci.ConsTaules.Descomptes;

namespace DeltaFlex.Negoci
{
    public class Descomptes
    {
        #region Variables
        private int _idDescompte;
        private decimal _descompte;
        private string _descDescompte;
        #endregion 

        #region Atributs
        public int IdDescompte
        {
            get { return _idDescompte; }
        }

        public decimal Descompte
        {
            get { return _descompte; }
            set { _descompte = value; }
        }

        public string DescDescompte
        {
            get { return _descDescompte; }
            set { _descDescompte = value; }
        }
        #endregion

        #region Mapeig
        public static Descomptes MapEntityFromDataReader(IDataReader record)
        {
            Descomptes descompte = new Descomptes();

            MemberAllocation.Allocate(record, Taula.COLUMNA_IDDESCOMPTE, ref descompte._idDescompte);
            MemberAllocation.Allocate(record, Taula.COLUMNA_DESCOMPTE, ref descompte._descompte);
            MemberAllocation.Allocate(record, Taula.COLUMNA_DESCDESCOMPTE, ref descompte._descDescompte);

            return descompte;
        }
        #endregion
    }
}
